package com.gao.autowired.constructor;

import com.gao.autowired.AllWantBean;
import org.springframework.stereotype.Component;

/**
 *
 *
 * @author GaoXi
 * @date 2022/2/24 19:37
 */
@Component
public class ConstructorTest1 {
    private AllWantBean allWantBean;


    /**
     * 构造方法上即使没有@Autowired 5.1以后也可以用
     * @param allWantBean
     */
    public ConstructorTest1(AllWantBean allWantBean) {
        this.allWantBean = allWantBean;
    }

    @Override
    public String toString() {
        return "ConstructorTest1{" +
            "allWantBean=" + allWantBean +
            '}';
    }
}
